package com.youthfilmic.yuejian.util;


/**
 * @title 处理整体的手机验证码发送流程
 * @author Dxywx
 * 
 * */
public class MobileCodeUtil {

	//储存发送的验证码
	public static final String preKeyForPassNum = "SENDMESSAGEPHONE|PASSNUM:";


	public static boolean verifyPhoneAndCode(String phoneNum , String code){
		String temp = preKeyForPassNum + phoneNum;
		if (code == null || phoneNum == null || !RedisUtil.contains(temp)){
			return false;
		}else{
			String mcode = RedisUtil.get(temp);
			return code.equals(mcode);
		}
	}
	
	public static void clearPhoneCode(String phoneNum){
		String temp = preKeyForPassNum + phoneNum;
		RedisUtil.delete(temp);
	}
}
